<template>
  <div class="bigD-cont">
    <i class="bigD-cont-lt"></i>
    <i class="bigD-cont-rt"></i>
    <i class="bigD-cont-lb"></i>
    <i class="bigD-cont-rb"></i>
    <span class="bigD-cont-title">报名总数</span>
    <div class="bigD-cont-echart">
      <IEcharts :option="bar"></IEcharts>
    </div>
  </div>
</template>

<script>
import IEcharts from "vue-echarts-v3";
export default {
  name: "registerTotals",
  props: ["regCount"],
  components: { IEcharts },
  data() {
    return {
      bar: {
        tooltip: {
          trigger: "axis",
          formatter: "{a}</br>{b}年 : {c} 人",
          axisPointer: {
            type: "shadow"
          }
        },
        barWidth: "30%",
        itemStyle: {
          color: "#0abfbc"
        },
        grid: {
          top: "10%",
          left: "3%",
          right: "10%",
          bottom: "3%",
          containLabel: true
        },
        xAxis: {
          type: "value",
          boundaryGap: [0, 0.01],
          axisTick: {
            //刻度线
            show: false
          },
          axisLabel: {
            color: "#fefeff"
          },
          axisLine: {
            lineStyle: {
              color: "#545d6f"
            }
          },
          splitLine: {
            lineStyle: {
              width: "10",
              color: "#162741",
              opacity: "0.8"
            }
          }
        },
        yAxis: {
          type: "category",
          data: this.regCount.yearChart.keyList,
          axisTick: {
            //刻度线
            show: false
          },
          axisLabel: {
            color: "#fefeff",
            margin: 15
          },
          axisLine: {
            show: false
          },
          splitLine: {
            show: true,
            lineStyle: {
              width: "1",
              color: "#162741",
              opacity: "0.8"
            }
          }
        },
        series: [
          {
            name: "报名人数",
            type: "bar",
            data: this.regCount.yearChart.valList
          }
        ]
      }
    };
  }
};
</script>

